package com.mlnx.netty.base.handler;


import com.mlnx.data.entity.SpoInfo;
import com.mlnx.netty.base.message.SpoMessage;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * Created by amanda.shan on 2018/2/12.
 */
public class PushSpoHandle extends SimpleChannelInboundHandler<SpoMessage> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, SpoMessage msg) {

        String deviceId = msg.getDeviceId();

        SpoInfo spoInfo = new SpoInfo();
        spoInfo.setDeviceId(deviceId);
        spoInfo.setPatientId(msg.getPatientId());
        spoInfo.setTime(msg.getPacketTime());

        spoInfo.setResultSPO(msg.getSpo());
        spoInfo.setResultHeart(msg.getHeart());
    }
}
